<style>
    body{
        background:url(images/background.jpg);
    }
</style>

<img id="pic"
     style="position:absolute;right:100px;top:100px"
     src="images/1 (1).png" />

<script>
    var i = 1;
    var n=100;
    function f(){
        if(i==32) i = 1;
        pic.src = "images/1 ("+i+").png";
        i++;
	n=n+2;
	pic.style.right=""+n+"px";
    }
    setInterval(f,100);
</script>
